<%@ include file="include.jsp" %>
<body>
	<h1>Hi there,</h1>
	<form id="login-form" action="authentificate" method="post">
		<table>
			<tr>
				<td><label id="loginLabel">Login : </label></td>
				<td><input id="login" name="login" /></td>
			</tr>

			<tr>
				<td><label id="passwordLabel">Password : </label></td>
				<td><input id="password" type="password" name="password"/></td>
			</tr>
		</table>
		<p id="error"></p>
		<input type="button" value="Save" onclick="checkValuesBeforeSubmit()" />
		<input type="reset" value="Cancel" />
	</form>
</body>

<script type="text/javascript">
	function checkValuesBeforeSubmit() {
		var isOk = true;
		if (isOk) {
			document.forms["login-form"].submit();
		} else {
			document.getElementById("error").innerHTML = "You must fill in all this attributes with (*)";
		}
	}
</script>
</html>